<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org"
      xmlns:tiles="http://www.thymeleaf.org">

<head>
    <meta charset="UTF-8"/>
    <title tiles:fragment="title">setInfo</title>

    <link href="../../../static/css/all.css" rel="stylesheet" type="text/css"/>
    <script src="../../../static/js/main.js"></script>
</head>

<body>

<div tiles:fragment="content" th:fragment="content" class="content">
    <div class="content-nav">
        <div class="titleNav">
            <div class="title_nav title_nav_previous">
                <a href="additem.html">添加物品</a>
            </div>
            <div class="title_nav title_nav_Now">
                <a>详细信息</a>
            </div>
        </div>
    </div>

    <div class="content-info myInfoList myInput">
        <!--/*@thymesVar id="itemForm" type="com.repository.web.storage.AddStorageForm.ItemForm"*/-->
        <form action="additem.html" method="post"
              th:action="@{additem}">
            <input type="hidden" name="isInschool" th:value="${isInschool}"/>
            <ul>
                <li th:if="${isInschool == 0}">
                    <label>
                        <div class="name">
                            物品编码：
                        </div>
                        <div class="value">
                            <input type="text" name="itemCode"/>
                        </div>
                    </label>
                </li>
                <li>
                    <label>
                        <div class="name">
                            物品名称：
                        </div>
                        <div class="value">
                            <input type="text" name="itemName"/>
                        </div>
                    </label>
                </li>
                <li>
                    <label>
                        <div class="name">
                            物品类别：
                        </div>
                        <div class="value">
                            <select name="itemCategoryID" th:if="${#httpServletRequest.getParameter('isInschool')=='1'}">
                                <!--/*@thymesVar id="category" type="com.repository.entity.CategoryEntity"*/-->
                                <option value=""></option>
                                <option th:if="${session.categoriesA == null || session.categoriesA.empty}">
                                    没有找到分类,请刷新重试
                                </option>
                                <option th:each="category : ${session.categoriesA}"
                                        th:value="${category.categoryId}"
                                        th:text="${category.categoryName}">
                                </option>
                            </select>
                            <select name="itemCategoryID" th:if="${#httpServletRequest.getParameter('isInschool') != '1'}">
                                <!--/*@thymesVar id="category" type="com.repository.entity.ItemCategoryEntity"*/-->
                                <option value=""></option>
                                <option th:if="${session.categories == null || session.categories.empty}">
                                    没有找到分类,请刷新重试
                                </option>
                                <option th:each="category : ${session.categories}"
                                        th:value="${category.categoryId}"
                                        th:text="${category.categoryName}">
                                </option>
                            </select>
                        </div>
                    </label>
                    <div class="icon-after-plus" onclick="openPopById('pop_addCategory')"></div>
                </li>
                <li>
                    <label>
                        <div class="name">
                            入库数量：
                        </div>
                        <div class="value">
                            <input type="number" name="itemCount" min="1" max="100"/>
                        </div>
                    </label>
                </li>
                <li>
                    <label>
                        <div class="name">
                            入库单价：
                        </div>
                        <div class="value">
                            <input type="text" name="itemPrice"/>
                        </div>
                    </label>
                </li>
                <li>
                    <label>
                        <div class="name">
                            物品规格：
                        </div>
                        <div class="value">
                            <input type="text" name="itemSpec"/>
                        </div>
                    </label>
                </li>
                <li>
                    <label>
                        <div class="name">
                            有效期限：
                        </div>
                        <div class="value">
                            <input type="date" name="itemEffectiveDate"/>
                        </div>
                    </label>
                </li>
                <li>
                    <label>
                        <div class="name">
                            物品介绍：
                        </div>
                        <div class="value">
                            <input type="text" name="itemIntroduce"/>
                        </div>
                    </label>
                </li>
                <li>
                    <label>
                        <div class="name">
                            发票代码：
                        </div>
                        <div class="value">
                            <input type="text" name="billCode"/>
                        </div>
                    </label>
                </li>
                <li>
                    <label>
                        <div class="name">
                            生成厂商：
                        </div>
                        <div class="value">
                            <select name="itemCompanyID">
                                <!--/*@thymesVar id="companyID" type="com.repository.entity.CompanyEntity"*/-->
                                <option value=""></option>
                                <option th:if="${session.companies == null || session.companies.empty}">
                                    没有找到分类,请刷新重试
                                </option>
                                <option th:each="company : ${session.companies}"
                                        th:value="${company.getCompanyId()}"
                                        th:text="${company.getCompanyName()}">
                                </option>
                            </select>
                        </div>
                    </label>
                    <div class="icon-after-plus" onclick="openPopById('pop_addCompany')"></div>
                </li>
                <li>
                    <label>
                        <div class="name">
                            物品批次：
                        </div>
                        <div class="value">
                            <input type="text" name="itemBatch"/>
                        </div>
                    </label>
                </li>
                <li>
                    <label>
                        <div class="name">
                            入库库位：
                        </div>
                        <div class="value">
                            <input type="text" name="itemSlot"/>
                        </div>
                    </label>
                </li>

                <li>
                    <div>
                        <input type="submit" value="提交信息"/>
                    </div>
                </li>
            </ul>
        </form>

        <div id="pop_addCategory" class="pop-bg">
            <div class="pop myInfoList myInput">
                <div class="pop-close">
                    <div class="close_button" onclick="closePopById('pop_addCategory')">
                        <div class="close_button-icon"></div>
                    </div>
                </div>
                <form id="form_addCategory" method="post">
                    <ul>
                        <li>
                            <label>
                                <div class="name">
                                    类别：
                                </div>
                                <div class="value">
                                    <input type="radio" name="itemCategory" value="A类" checked="checked"/>A类&nbsp;&nbsp;&nbsp;&nbsp;
                                    <input type="radio" name="itemCategory" value="非A类"/>非A类
                                </div>
                            </label>
                        </li>
                        <li>
                            <label>
                                <div class="name">
                                    分类名称：
                                </div>
                                <div class="value">
                                    <input type="text" name="categoryName"/>
                                </div>
                            </label>
                        </li>
                        <li>
                            <input type="button" onclick="closePop()" value="取消"/>
                            <input type="button" onclick="addCategory()" value="增加分类"/>
                        </li>
                    </ul>
                </form>
            </div>
        </div>

        <div id="pop_addCompany" class="pop-bg">
            <div class="pop myInfoList myInput">
                <div class="pop-close">
                    <div class="close_button" onclick="closePopById('pop_addCompany')">
                        <div class="close_button-icon"></div>
                    </div>
                </div>
                <form id="form_addCompany" method="post">
                    <ul>
                        <li>
                            <label>
                                <div class="name">
                                    厂家名称：
                                </div>
                                <div class="value">
                                    <input type="text" name="companyName"/>
                                </div>
                            </label>
                        </li>
                        <li>
                            <label>
                                <div class="name">
                                    厂家地址：
                                </div>
                                <div class="value">
                                    <input type="text" name="companyAddress"/>
                                </div>
                            </label>
                        </li>
                        <li>
                            <label>
                                <div class="name">
                                    联系方式：
                                </div>
                                <div class="value">
                                    <input type="text" name="companyPhone"/>
                                </div>
                            </label>
                        </li>
                        <li>
                            <input type="button" onclick="closePop()" value="取消"/>
                            <input type="button" onclick="addCompany()" value="增加厂商"/>
                        </li>
                    </ul>
                </form>
            </div>
        </div>

    </div>
</div>

</body>
</html>